{{- if and .Values.cni.enabled (not .Values.experimental.ebpf.enabled) }}
kind: ConfigMap
apiVersion: v1
metadata:
  name: {{ include "kuma.name" . }}-cni-config
  namespace: {{ .Values.cni.namespace }}
  labels: {{ include "kuma.cniLabels" . | nindent 4 }}
data:
  # The CNI network configuration to add to the plugin chain on each node.
  cni_network_config: |-
    {
      "cniVersion": "0.3.1",
      "name": "kuma-cni",
      "type": "kuma-cni",
      "log_level": "{{ .Values.cni.logLevel }}",
      "kubernetes": {
          "kubeconfig": "__KUBECONFIG_FILEPATH__",
          "cni_bin_dir": "{{ .Values.cni.binDir }}",
          "exclude_namespaces": [ "kube-system" ]
      }
    }
    {{- end }}
